home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
util1
/
xpkilzr.lha
/
xpkILZR
/
source
/
XPK.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-19
|
2KB
|
101 lines
/*
* This library is mainly intended to demonstrate how to program an
* encryption sub library/
*/
#include <stdio.h>
#include "ilzr.h"
char __VersTag__[]="$VER: xpkIZLR.library 1.2 ("__DATE__") Jose Renau";
#define NO_SUB_PRAGMAS
#include <string.h>
#include <stdlib.h>
#include <libraries/xpksub.h>
#define A3000 XPKMF_A3000SPEED
XMINFO ILZRMode = {
NULL, // next
100, // upto
A3000, // flags
0, // packmem
0, // unpackmem
200, // packspeed, K/sec
300, // unpackspeed, K/sec
655, // ratio, *0.1%
0, // reserved
"Fast" // description
};
static struct XpkInfo ILZRInfo = {
1, /* info version */
0, /* lib version */
0, /* master vers */
0, /* pad */
"ILZR", /* short name */
"Incremental Lempel Ziv Renau",
/* long name */
"A very fast low memory compression, fast hash version of LZSS",
/* description*/
'ILZR', /* 4 letter ID */
XPKIF_PK_CHUNK |/* flags */
XPKIF_UP_CHUNK |
XPKIF_MODES,
16*1024, /* max in chunk */
0, /* min in chunk */
16*1024, /* def in chunk */
"Compressing", /* pk message */
"Expanding", /* up message */
"Packed", /* pk past msg */
"unpacked", /* up past msg */
50, /* def mode */
0, /* pad */
&ILZRMode /* modes */
};
/**------------------------------------------------------------------
* Retorna la estructura de información usada en el
* compresor de datos.
*
**/
struct XpkInfo * __saveds __asm
XpksPackerInfo( void )
{
return &ILZRInfo;
}
void __saveds __asm
XpksPackFree( REG __a0 XPARAMS* xpar )
{
if( xpar->Sub[0] )
{
free( (void *)xpar->Sub[0] ); /* free( prev ); */
xpar->Sub[0]=0;
}
if( xpar->Sub[1] )
{
free( (void *)xpar->Sub[1] ); /* free( head ); */
xpar->Sub[1]=0;
}
}
long __saveds __asm
XpksPackReset( REG __a0 XPARAMS* xpar )
{
if( xpar->Sub[1] )
memset( (void *)xpar->Sub[1] , NIL , HASH_SIZE*sizeof( UWORD ) ); /* head */
return 0;
}
void __saveds __asm
XpksUnpackFree( REG __a0 XPARAMS* xpar )
{
}